/**
 * 版权所有 (C), 2019-2019, XXX有限公司
 * 项目名：com.company.study.dsa.linkedlist
 * 文件名: StackSingleLink
 * 日期: 2019/6/18 14:34
 * 说明:
 */
package com.company.study.dsa.linkedlist;

/**
 * 用单向链表实现栈
 *
 * @author Anbang713
 * @create 2019/6/18
 */
public class StackSingleLink {

    private SingleLinkedList linkedList;

    public StackSingleLink() {
        linkedList = new SingleLinkedList();
    }

    public void push(Object data) {
        linkedList.addHead(data);
    }

    public Object pop() {
        return linkedList.deleteHead();
    }

    public boolean isEmpty() {
        return linkedList.isEmpty();
    }

    public void display() {
        linkedList.display();
    }
}